package com.itheima.io.properties.demo02;

import java.util.Properties;
import java.util.Set;

public class PropertiesDemo01 {

    public static void main(String[] args) {

        Properties prop = new Properties();

        prop.setProperty("王五", "25");
        prop.setProperty("赵六", "24");
        prop.setProperty("田七", "12");
        prop.setProperty("哈哈", "34");

        Set<String> names = prop.stringPropertyNames();
        for(String name : names) {
            System.out.println(name);
        }

        System.out.println("-----------------------------------------------------");

        System.out.println(prop);

        System.out.println("-----------------------------------------------------");

        Set<String> keys = prop.stringPropertyNames();
        for(String key : keys) {
            String value = prop.getProperty(key);
            System.out.println(key + "-----" + value);
        }

    }

}
